Class TKSegment
The TKSegment provides a TuneKit data type to deal with segments in 2D space and some utilities to work with them, such as figuring out
the shortest distance between a segment and a point.
Defined in: Utils.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
TKSegment(a, b)
|
| Field Attributes | Field Name and Description |
|---|---|
|
The first extremity of the segment.
|
|
|
The other extremity of the segment.
|
|
|
The segment's length.
|
| Method Attributes | Method Name and Description |
|---|---|
distanceToPoint(aPoint)
Computes the shortest distance between this segment and the given point.
|
Class Detail
TKSegment(a, b)
- Parameters:
-
{
TKPoint} a - The first extremity of the segment.
-
{
TKPoint} b - The other extremity of the segment.
- Since:
- TuneKit 1.0
Field Detail
{
TKPoint}
a
The first extremity of the segment.
{
TKPoint}
b
The other extremity of the segment.
{float}
length
The segment's length.
Method Detail
{float}
distanceToPoint(aPoint)
Computes the shortest distance between this segment and the given point.
- Parameters:
-
{
TKPoint} aPoint
- Returns:
- {float} The shortest distance between this segment and the given point.